package study.android;

import java.io.File;

import android.os.Environment;

public class g {

	public static final String AppCode = "StudyAndroid";
	private static String dataPath;

	public static String getDataPath() {
		if (dataPath == null) {
			String sdCardPath = Environment.getExternalStorageDirectory().getAbsolutePath();
			dataPath = sdCardPath + "/" + AppCode;

			File file = new File(dataPath);
			if (!file.exists()) {
				try {
					file.mkdirs();
					if (!file.exists())
						throw new Exception("创建目录 {" + dataPath + "} 失败!");
				} catch (Exception exp) {
					exp.printStackTrace();
				}
			}
		}
		return dataPath;
	}

	public static LocalDb ldb;
}
